<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
 
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<div class="container">
<form:form action="edit" method="post" commandName="contendor" enctype="multipart/form-data" cssClass="form-horizontal">            
        <br><br>
        <h3>Modificar Contendor</h3> 
        <div class="row">
        <div class="hero-unit-min">  
        <form:hidden path="idcontendor"></form:hidden>
        <table align="center" border=0 cellspacing=2 cellpadding=4 width="90%" height="50px" bordercolor=red >
            <tr>
                <td>Contendor:</td>
                <td> 
                    <form:input path="nocontendor" maxlength="30" cssClass="input-large"></form:input>
                    <form:errors path="nocontendor" cssstyle="color:red"></form:errors>
                </td>
                <td>Tipo:</td>
                    <td>
                    <form:select path="fltipo">
                        <c:if test="${contendor.fltipo==1}">
                        <option value="1" selected="selected">Imagen</option>
                        <option value="2">Texto</option>
                        </c:if>     
                        <c:if test="${contendor.fltipo==2}">
                        <option value="2" selected="selected">Texto</option>
                        <option value="1">Imagen</option>
                        </c:if>     
                        </form:select>
                        <form:errors path="fltipo" cssstyle="color:red"></form:errors>
                    </td>
             </tr>
            <tr>
                <td>Imagen:</td>
                 <td>            <!--form:input path="noimagen"><!--/form:input-->
                     <form:input  path="avatar" type="file"/>
                     <form:errors path="avatar" cssstyle="color:red"></form:errors>
                 </td>

                <td>Texto:</td>
                <td>
                    <form:input path="txtexto" maxlength="30" cssClass="input-large"></form:input>
                    <form:errors path="txtexto" cssstyle="color:red"></form:errors>
                </td>
            </tr>
            <tr>
                <td>Fecha Registro:</td>
                <td>
                    <form:input path="fcregistro" disabled="true"></form:input>
                    <form:errors path="fcregistro" cssstyle="color:red"></form:errors>
                </td>
                <td>Estado:</td>
                <td>
                    <form:select path="idestado">
                        <c:if test="${contendor.idestado==1}">
                            <option value="1" selected="selected">Activo</option>
                            <option value="0">Inactivo</option>
                        </c:if> 
                          <c:if test="${contendor.idestado==0}">
                            <option value="1">Activo</option>
                            <option value="0" selected="selected">Inactivo</option>
                        </c:if>
                    </form:select>
                    <form:errors path="idestado" cssstyle="color:red"></form:errors>
                </td>                
            </tr>
            <tr align="center">
                <td colspan="4">
                    <input name="" value="Grabar" type="submit" class="btn btn-mini btn-primary">
                    <a style="margin-left: 5px;" href="<c:url value='/pages/contendor/index'/>" class="btn btn-mini btn-primary">Cancelar</a>
                </td>
            </tr>
            </table>
        </div>
        </div>
     </form:form>
</div>
